<?php
    include("./dbconn.php");

    // 获取编辑后新的商品信息
    $title = $_GET["title"];
    $imgUrl = $_GET["imgUrl"];
    $hot = $_GET["hot"];
    $id = $_GET["id"];
    $sql = "update midata set title='$title', imgUrl='$imgUrl', hot='$hot' where Id=$id";

    if($conn->query($sql)){
        $data["code"] = 0;
    }else{
        $data["code"] = 1;
    }
    echo json_encode($data);
?>